package com.suedawn.bookmanagesystem.controller;

import com.suedawn.bookmanagesystem.dto.BorrowRecordDTO;
import com.suedawn.bookmanagesystem.entity.BorrowRecord;
import com.suedawn.bookmanagesystem.service.BorrowRecordService;
import com.suedawn.bookmanagesystem.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/borrow")
public class BorrowRecordController {
    @Autowired
    private BorrowRecordService borrowRecordService;


    @GetMapping("/list")
    public R listBorrow(BorrowRecordDTO record){
        return borrowRecordService.listBorrow(record);
    }
//    @GetMapping("/list")
//    public R listBorrow(){
//        List<BorrowRecord> list = borrowRecordService.list();
//        return list!=null?R.ok(list):R.error();
//    }


}
